<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page contentType="text/html; charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'regmsg.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<%
		String msg = (String) session.getAttribute("msg");
		session.setAttribute("msg","");
	%>
	<script type="text/javascript" >
		window.alert("<%=msg%>");
		<%
			if(msg.equals("下单成功！请确认订单后支付")){%>
				window.location.href="<%=basePath%>user/orderform.jsp";
			<%}%>
		<%	if(msg.equals("下单失败！请重新下单")){%>
				window.location.href="<%=basePath%>user/placeorder.jsp";
			<%}%>
		<%	if(msg.equals("取消成功！")){%>
				window.location.href="<%=basePath%>user/index.jsp";
			<%}%>
		<%	if(msg.equals("取消失败！")){%>
				window.location.href="<%=basePath%>user/index.jsp";
			<%}%>
		<%	if(msg.equals("支付失败！")){%>
				window.location.href="<%=basePath%>user/index.jsp";
			<%}%>
		<%	if(msg.equals("支付成功！")){%>
				window.location.href="<%=basePath%>user/index.jsp";
			<%}%>
		<%	if(msg.equals("已确认订单！请支付")){%>
				window.location.href="<%=basePath%>user/orderform.jsp";
			<%}%>
		<%	if(msg.equals("确认失败！")){%>
				window.location.href="<%=basePath%>user/orderform.jsp";
			<%}%>
		<%	if(msg.equals("修改失败！")){%>
				window.location.href="<%=basePath%>user/index.jsp";
			<%}%>
		<%	if(msg.equals("修改成功！")){
		System.out.println(msg);%>
				window.location.href="<%=basePath%>user/index.jsp";
			<%}%>
		<%	if(msg.equals("修改订单成功！")){%>
				window.location.href="<%=basePath%>user/order.jsp";
			<%}%>
		<%	if(msg.equals("修改订单失败！")){%>
				window.location.href="<%=basePath%>user/order.jsp";
			<%}%>
		<%	if(msg.equals("兑换失败！")){%>
				window.location.href="<%=basePath%>user/creditex.jsp";
			<%}%>
		<%	if(msg.equals("兑换失败！已有优惠劵，请先使用")){%>
				window.location.href="<%=basePath%>user/index.jsp";
			<%}%>
		<%	if(msg.equals("兑换成功！")){
		System.out.println(msg);%>
				window.location.href="<%=basePath%>user/index.jsp";
			<%}%>
		<%	if(msg.equals("兑换失败！积分不足")){%>
				window.location.href="<%=basePath%>user/creditex.jsp";
			<%}%>
		<%	if(msg.equals("兑换失败！优惠券已被兑完")){%>
				window.location.href="<%=basePath%>user/creditex.jsp";
			<%}%>
	</script>
  </head>
  
  <body>
  </body>
</html>
